/*
 * PercentageValue.java
 *
 * Created on 28 September 2003, 00:17
 *
 * Copyright 2008 the Desert Labs Project (http://desertlabs.us)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package us.desertlabs.number;

/**
 * This class is used to represent any number that can fall within the range 0
 * to 100, defined by the <CODE>PercentageRange</CODE> class. It stores not
 * only the minimum and maximum values of the range, but also a single current
 * value setting that falls somewhere inside that range.
 *
 * @author Brandon Franklin
 */
public class PercentageValue extends RangedNumber {

    private static final long serialVersionUID = 3258411716269257267L;

    /**
     * Creates a new <code>PercentageValue</code>. The value itself will be
     * set to the default, which is 0.
     */
    public PercentageValue() {
        this( 0 );
    }

    /**
     * Creates a new <code>PercentageValue</code> with the current value set
     * to the specified value.
     *
     * @param value the current value
     * @throws IllegalArgumentException if the supplied current value does not
     *         fall within the supplied range
     */
    public PercentageValue( final Number value ) {
        super( new PercentageRange(), value );
    }
}
